home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / TupleDatabase / BTEqu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  3.7 KB  |  121 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        BTEqu.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef    __BTEQU__
  15. #define    __BTEQU__
  16.  
  17. #ifndef __FILES__
  18. #include <files.h>
  19. #endif
  20.  
  21. #define        caseSens    0x10        /* case sensitive = 16 */
  22. #define        diacNsens    0x20        /* diac not sensitive = 32 */
  23.  
  24. /* key descriptor */
  25. #define        kdSkip            0
  26. #define        kdByte            1    /* unsigned */
  27. #define        kdWord            4    /* unsigned */
  28. #define        kdLong            6    /* unsigned */
  29. #define        kdSignedByte    2    /* signed */
  30. #define        kdSignedWord    5    /* signed */
  31. #define        kdSignedLong    7    /* signed */
  32. #define        kdString        3
  33. #define        kdFLString        8    /* fixed length string */
  34. #define        kdDTString        9    /* replace default key for DTDB */
  35. #define        kdUseKCProc        10    /* always uses key comparison procedure    <28Mar90> */
  36.  
  37. typedef struct BTParam {
  38.     ParamBlockHeader
  39.     short    ioRefNum;        /* 24 */
  40.     short    ioBTNodeSize;    /* 26 */
  41.     short    ioBTMaxKLen;    /* 28 */
  42.     short    ioBTDepth;        /* 30 */
  43.     long    ioBTRecNum;        /* 32 */
  44.     long    ioBTNNodes;        /* 36 */
  45.     long    ioBTFreeNode;    /* 40 */
  46.     long    ioBTClumpSize;    /* 44 */
  47.     long    ioDirID;        /* 48 */
  48.     Ptr        ioBTKDPtr;        /* 52 */
  49.     short    ioBTKDReqCount;    /* 56 */
  50.     short    ioBTKDActCount;    /* 58 */
  51. } BTParam;
  52.  
  53. typedef struct BTIOParam {
  54.     ParamBlockHeader
  55.     short    ioRefNum;        /* 24 */
  56.     char    ioBTWriteFlag;    /* 26 used by BTFlush only */
  57.     char    ioPermssn;        /* 27 */
  58.     Ptr        ioMisc;            /* 28 */
  59.     Ptr        ioBuffer;        /* 32 */
  60.     long    ioReqCount;        /* 36 */
  61.     long    ioActCount;        /* 40 */
  62.     Ptr        ioBTKeyPtr;        /* 44 */
  63.     long    ioDirID;        /* 48 don't move above this */
  64.     long    ioBTHint1;        /* 52 */
  65.     long    ioBTHint2;        /* 56 */
  66.     short    ioBTHint3;        /* 60 */
  67.     short    ioBTHint4;        /* 62 reserved */
  68.     long    ioBTHint5;        /* 64 reserved */
  69.     short    ioBTPosMode;    /* 68 */
  70.     short    ioKReqCount;    /* 70 */
  71.     short    ioKActCount;    /* 72 */
  72.     long    ioBTRsrvUID;    /* 74 */
  73.     long    ioBTDataSize;    /* 78 */
  74.     Ptr        ioBTKCProc;        /* 82 */    /* only used by BTOpen, this will override KD */
  75. } BTioParam;
  76.  
  77.  
  78. #define        kdMaxLen        24
  79. #define        MaxKeyLen        129            /* doesn't include length byte */
  80.  
  81. /* error code */
  82. #define        notBTree        -410
  83. #define        btBadNode        -411
  84. #define        btSizeErr        -412
  85. #define        btNoSpace        -413
  86. #define        btDupRecErr        -414
  87. #define        btRecNotFnd        -415
  88. #define        btKeyLenErr        -416
  89. #define        btKeyAttrErr    -417
  90. #define     btKeyFdErr        -418
  91. #define     btPMInvalid        -419
  92. #define     btKDLenErr        -420
  93. #define     btKDTypeErr        -421
  94. #define        btBadUIDErr        -422
  95.  
  96. #define        btNoKDErr        -424            /* no key descriptor in the header */
  97. #define        btDepthErr        -425            /* tree depth > maxDepth        <04Apr90> */
  98. #define        btNoKCProcErr    -426            /* no Key Comp procedure error    <28Mar90> */
  99. #define        btVersionErr    -427            /* Btree version error (for future release) */
  100. #define        btEofErr        -428            /* BTGetRec reading beyond EOF */
  101. #define        btBofErr        -429            /* BTGetRec reading before BOF */
  102.  
  103. pascal short BTInit         (BTParam   *btparam,   short async);
  104. pascal short BTOpen         (BTioParam *btioparam, short async);
  105. pascal short BTClose     (BTioParam *btioparam, short async);
  106. pascal short BTInsRec     (BTioParam *btioparam, short async);
  107. pascal short BTSetRec     (BTioParam *btioparam, short async);
  108. pascal short BTReplRec     (BTioParam *btioparam, short async);
  109. pascal short BTSearch     (BTioParam *btioparam, short async);
  110. pascal short BTGetRec     (BTioParam *btioparam, short async);
  111. pascal short BTDelete     (BTioParam *btioparam, short async);
  112. pascal short BTGetInfo     (BTParam   *btparam,   short async);
  113. pascal short BTFlush     (BTioParam *btioparam, short async);
  114. pascal short BTCleanUp     (BTioParam *btioparam, short async);
  115. pascal short BTRsrvAccess(BTioParam *btioparam, short async);
  116. pascal short BTRelAccess (BTioParam *btioparam, short async);
  117. pascal short BTGetUid      (BTioParam *btioparam, short async);
  118. pascal short BTUpdateKD     (BTParam   *btparam,   short async);
  119.  
  120. #endif    // __BTEQU__
  121.